package com.white.bean;

import com.baomidou.mybatisplus.annotation.TableId;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * -- 用户模型：用户模型ID、用户ID、文章分类ID、浏览次数、浏览时长、点赞次数、评论次数、打赏次数。
 * create table userModel(
 * userModelId int primary key AUTO_INCREMENT comment "用户模型ID",
 * userId int comment "用户ID",
 * foreign key(userId) REFERENCES user(userId) on delete cascade on update cascade,
 * classifyId int comment "文章分类ID",
 * foreign key(classifyId) REFERENCES classify(classifyId) on delete cascade on update cascade,
 * views int not null default 0 comment "浏览数",
 * likes int not null default 0 comment "点赞数",
 * comments int not null default 0 comment "评论数",
 * rewards int not null default 0 comment "打赏数"
 * viewDuration float not null default 0 comment "浏览时长",
 * );
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class UserModel {
    @TableId("userModelId")
    private Long userModelId;
    private Long userId, recommendUserId, classifyId;
    private int views, likes, comments, rewards;
    private float viewDuration;

    public UserModel(Long userId, Long classifyId) {
        this.userId = userId;
        this.classifyId = classifyId;
    }
}
